Skip to content

Conversation

@anyj0527
Copy link

@anyj0527 anyj0527 commented Nov 14, 2025

  • currently cmake install targets of kleidiai generate error
  • set EXCLUDE_FROM_ALL in FetchContent_MakeAvailable for cmake 3.28+
  • use FetchContent_Populate for cmake version less than 3.28
  • note that FetchContent_Populate is deprecated in 3.30

Tested cmake v4.0.0 and cmake v3.22.1

Current install error log:

$ cmake --install build-kai --prefix install-kai
-- Install configuration: "Release"
-- Installing: /home/yongjoo/llama.cpp/install-kai/lib/libggml-cpu.so
CMake Error at build-kai/_deps/kleidiai_download-build/cmake_install.cmake:52 (file):
  file INSTALL cannot find
  "/home/yongjoo/llama.cpp/build-kai/bin/libkleidiai.so": No such file or
  directory.
Call Stack (most recent call first):
  build-kai/ggml/src/cmake_install.cmake:71 (include)
  build-kai/ggml/cmake_install.cmake:47 (include)
  build-kai/cmake_install.cmake:47 (include)

would be fixed.

@github-actions github-actions bot added the ggml changes relating to the ggml tensor library for machine learning label Nov 14, 2025
@ggerganov ggerganov requested a review from chaxu01 November 14, 2025 07:40
URL_HASH MD5=${KLEIDIAI_ARCHIVE_MD5})
URL_HASH MD5=${KLEIDIAI_ARCHIVE_MD5}
SOURCE_SUBDIR pathThatDoesNotExist # Prevent all targets to be executed
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using SOURCE_SUBDIR pathThatDoesNotExist to suppress target creation could be problematic. If CMake validates the path or the KleidiAI project layout changes, this could fail at configure time. An alternative would be to use FetchContent_Populate() instead of FetchContent_MakeAvailable(), and then not add the KleidiAI subdirectory at all.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chaxu01 Thanks for your clean review.

At first I consider FetchContent_Populate which do the same fix but cmake generates deprecation warning about it. Then I found the SOURCE_SUBDIR bypass.

Still your concern is valid, I've updated this commit to use FetchContent_Populate, PTAL

@anyj0527 anyj0527 force-pushed the fix-kleidiai-install branch from a02af4c to 2664317 Compare November 17, 2025 04:46
@anyj0527 anyj0527 force-pushed the fix-kleidiai-install branch from 2664317 to be75572 Compare November 24, 2025 07:30
@slaren
Copy link
Member

slaren commented Nov 24, 2025

Since it seems that FetchContent now is being used only to download and extract the archive, would it make sense to use thee file command directly to do so, rather than using a deprecated command?

* currently cmake install targets of kleidiai generate error
* set EXCLUDE_FROM_ALL in `FetchContent_MakeAvailable` for cmake 3.28+
* use `FetchContent_Populate` for cmake version less than 3.28
* note that `FetchContent_Populate` is deprecated in 3.30

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
@anyj0527 anyj0527 force-pushed the fix-kleidiai-install branch from be75572 to 458952e Compare November 27, 2025 08:17
@anyj0527
Copy link
Author

anyj0527 commented Nov 27, 2025

@slaren
I think handling required source files using FILE or GLOB will introduce extra burden to contributers.
I updated this patch as:

  • set EXCLUDE_FROM_ALL in FetchContent_MakeAvailable for cmake 3.28+
  • use FetchContent_Populate for cmake version less than 3.28

FetchContent_Populate is deprecated in version 3.30, so there would be no annoying deprecation warnings. I tested tested cmake v4.0.0 and cmake v3.22.1.
PTAL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ggml changes relating to the ggml tensor library for machine learning

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants